/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidade;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author thulioa
 */
@Entity
@Table(name = "cliente")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ClienteEntidade.findAll", query = "SELECT c FROM ClienteEntidade c"),
    @NamedQuery(name = "ClienteEntidade.findById", query = "SELECT c FROM ClienteEntidade c WHERE c.id = :id"),
    @NamedQuery(name = "ClienteEntidade.findByValorUltimaCompra", query = "SELECT c FROM ClienteEntidade c WHERE c.valorUltimaCompra = :valorUltimaCompra"),
    @NamedQuery(name = "ClienteEntidade.findByValorTotalCompra", query = "SELECT c FROM ClienteEntidade c WHERE c.valorTotalCompra = :valorTotalCompra"),
    @NamedQuery(name = "ClienteEntidade.findByKeyCliente", query = "SELECT c FROM ClienteEntidade c WHERE c.keyCliente = :keyCliente")})
public class ClienteEntidade implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "valor_ultima_compra")
    private BigDecimal valorUltimaCompra;
    @Column(name = "valor_total_compra")
    private BigDecimal valorTotalCompra;
    @Column(name = "key_cliente")
    private String keyCliente;

    public ClienteEntidade() {
    }

    public ClienteEntidade(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigDecimal getValorUltimaCompra() {
        return valorUltimaCompra;
    }

    public void setValorUltimaCompra(BigDecimal valorUltimaCompra) {
        this.valorUltimaCompra = valorUltimaCompra;
    }

    public BigDecimal getValorTotalCompra() {
        return valorTotalCompra;
    }

    public void setValorTotalCompra(BigDecimal valorTotalCompra) {
        this.valorTotalCompra = valorTotalCompra;
    }

    public String getKeyCliente() {
        return keyCliente;
    }

    public void setKeyCliente(String keyCliente) {
        this.keyCliente = keyCliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClienteEntidade)) {
            return false;
        }
        ClienteEntidade other = (ClienteEntidade) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidade.ClienteEntidade[ id=" + id + " ]";
    }
    
}
